using System.Web.Mvc;
using JaxDug.ViewModels;
using System.Collections.Generic;
using System.Linq;
using System;
using JaxDug.Helpers;
using JaxDug.Models;
namespace JaxDug.Areas.CodeCamp.Controllers
{
    public partial class SponsorController : Controller
    {
        private static Random rnd = new Random();



        [AllowAnonymous]
        public virtual ActionResult Index()
        {
            var sponsors = new List<Sponsor>()
                               {
                           
                                   new Sponsor(){ Image=Links.images.Sponsors.modis_logo_170x60_jpg, Name="Modis", Link="http://www.modis.com"},
                                   new Sponsor(){ Image=Links.images.Sponsors.sni_tech_logo_w600_jpg, Name="SNI", Link="http://www.snitechnology.com/"},
                                   new Sponsor(){ Image=Links.images.Sponsors.UNF_Logo_png, Name="UNF", Link="http://www.unf.edu//"},
                                   new Sponsor(){ Image=Links.images.Sponsors.TekSystems_png, Name="TekSystems", Link="http://www.teksystems.com/"},
                                   new Sponsor(){ Image=Links.images.Sponsors.Incepture_jpg, Name="Incepture", Link="http://www.incepture.com/"},
                                   new Sponsor(){ Image=Links.images.Sponsors.nas_logo_png, Name="New Age Solutions", Link="http://newagesolution.net"},

                               };

            return View(MVC.Sponsor.Views.Index,new SponsorListViewModel
            {
                Title = "Sponsors",
                SponsorList = sponsors//sponsors.OrderBy(s=>rnd.Next()).ToList() // _sponsorRepo.ListAllSponsors()
            });
        }

        //
        // GET: /Sponsor/Details/5
        [AllowAnonymous]

        public virtual ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /Sponsor/Create

        public virtual ActionResult Create()
        {
            return View();
        }

        //
        // POST: /Sponsor/Create

        [HttpPost]
        public virtual ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Sponsor/Edit/5

        public virtual ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /Sponsor/Edit/5

        [HttpPost]
        public virtual ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Sponsor/Delete/5

        public virtual ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /Sponsor/Delete/5

        [HttpPost]
        public virtual ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}